import { useCallback } from "react";
import CodeMirror from "@uiw/react-codemirror";
import { javascript } from "@codemirror/lang-javascript";

const TextAear = ({
  height,
  onChange,
  codeVal
}: {
  height: number;
  onChange: any;
  codeVal: string;
}) => {
  return (
    <CodeMirror
      theme="dark"
      value={codeVal}
      height={`calc(100vh - ${height}px)`}
      extensions={[javascript({ jsx: true })]}
      onChange={onChange}
    />
  );
};
export default TextAear;
